package twinkleberry

import scala.collection.mutable._
import Util._
import com.google.common.collect.Multimap

object FindDupes {
  def main(args:Array[String]) {
    val pathsForSize = new HashMap[Long, Set[String]]() with MultiMap[Long, String];
    Config.musicRoot.findFiles().filter(_.getName.endsWith(".mp3")).foreach(f => pathsForSize.addBinding(f.length, f.getAbsolutePath))
    for ( (size, files) <- pathsForSize.elements) {
      if (files.size > 1) {
        println(size)
        for (file <- files) {
          println("\t" + file)
        }
        println
      }
    }
  }
}